package com.google.bitcoin.core;

import java.math.BigInteger;

/**
 * Simple counts the number of inputs and outputs and pays a fee per element
 * or a min fee if that is higher
 */
public class FeeFinderCounting implements FeeFinder
{
    BigInteger min_fee=BigInteger.valueOf(100000L);
    BigInteger per_item=BigInteger.valueOf(20000L);

    public BigInteger getFeeForTx(Transaction tx, int change_outs)
    {
        int num = tx.getInputs().size() + tx.getOutputs().size() + change_outs;
        BigInteger item_fee = per_item.multiply(BigInteger.valueOf(num));

        return item_fee.max(min_fee);
    }


}
